package com.example.finance_oa.controller;

import com.example.comment_oa.pojos_vo.AdditionalVo;
import com.example.comment_oa.pojos_vo.AdjustVo;
import com.example.comment_oa.pojos_vo.ProcessVo;
import com.example.comment_oa.response.AjaxResponse;
import com.example.finance_oa.service.ProcessService;
import org.apache.ibatis.annotations.Param;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/financeOa")
public class ProcessController {
    @Autowired
    ProcessService processService;
    @RequestMapping("process/allProcess")
    public AjaxResponse allProcess(@RequestBody ProcessVo processVo){
        System.err.println(processVo.getJssj()+""+processVo.getJssj());
        return AjaxResponse.success(processService.allProcess(processVo));
    }

    //新增追加流程
    @RequestMapping("process/insertZjlc")
    public AjaxResponse insertZjlc(@RequestBody AdditionalVo additionalVo){
        return AjaxResponse.success(processService.insertZjlc(additionalVo));
    }

    //新增变更流程
    @RequestMapping("prcess/insertBglc")
    public AjaxResponse insertBglc(@RequestBody AdjustVo adjustVo){
        return AjaxResponse.success(processService.insertBglc(adjustVo));
    }

    //根据辨号查询追加流程
    @RequestMapping("process/selectByzj/{processBh}")
    public AjaxResponse selectByzj(@PathVariable("processBh") String processBh){
        return AjaxResponse.success(processService.selectBybh(processBh));
    }

    //根据辨号查询变更流程
    @RequestMapping("process/selectBybg/{processBh}")
    public AjaxResponse selectBybg(@PathVariable("processBh") String processBh){
        return AjaxResponse.success(processService.selectBybh2(processBh));
    }

}
